package com.liyunc.demo.custom.livechat;

import com.liyunc.demo.custom.livechat.manager.MainWindowFactory;
import com.liyunc.demo.custom.livechat.manager.ServerFactory;


import java.awt.*;
import java.io.IOException;

public class App {

    /**
     * main
     * @param args
     */
    public static void main(final String[] args) {
        EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                try {
                    // 启动客户端窗口
                    MainWindowFactory.getChatWindow();

                    new Thread(new Runnable() {
                        @Override
                        public void run() {
                            try {
                                // 启动服务端服务
                                ServerFactory.getSocketServer().serverStart(4000);
                            } catch (IOException e) {
                                e.printStackTrace();
                            }
                        }
                    }).start();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }
}
